{include file=header.html}
<script language="javascript" type="text/javascript" src="{res file=js/jquery-1.2.6.js}"></script>
<style type="text/css">
.page{float:left;}
</style>
<script type="text/javascript">
$(function(){
	$('th[type="order"]').click(function() {
		var order = $(this).attr('field') + '-' + $(this).attr('order');
		$('#order').val(order);
		$('input[name="search"]').click();
		}).css({'cursor': 'pointer', 'color': '#36c'});
		var order = $('#order').val().split('-');
		var field = $('th[type="order"][field="' + order[0] + '"]');
		if (order[1] == 'ASC') {
		field.attr('order', 'DESC').text(field.text() + '↑');
		} else {
		field.attr('order', 'ASC').text(field.text() + '↓');
		}
		if (order[0] != 'reg_time') {
		$('th[type="order"][field="reg_time"]').attr('order', 'DESC');
		}
});
</script>
<body>
<div class="sub-body">
	<div class="tab_info" style="width:898px;">
		<div class="tab-title-1"><span>{$lang.user_manage} </span></div>
		<form method="get">
			<table width="100%" cellspacing="0" cellpadding="0" class="search">
				<tr>
					<th width="100">{$lang.user_name}：</th>
					<td width="200"><input name="user_name" type="text" value="{$smarty.get.user_name|escape}" /></td>
					<th width="100">{$lang.email}：</th>
					<td width="200"><input name="email" type="text" value="{$smarty.get.email|escape}" /></td>
					<td width="100" rowspan="2">
						<input name="app" id="app" type="hidden" value="member" />
						<input name="act" id="act" type="hidden" value="user_list" />
						<input name="utype" id="utype" type="hidden" value="{$utype}"/>
						<input type="hidden" name="order" id="order" value="{if $smarty.get.order}{$smarty.get.order}{else}reg_time-DESC{/if}" />
						<input type="submit" name="search" value="查询" class="inquiry" /></td>
				</tr>
				<tr>
					<th>{$lang.phone_mob}：</th>
					<td><input name="phone_mob" type="text" value="{$smarty.get.phone_mob|escape}" /></td>
					<th>{$lang.im_qq}：</th>
					<td><input name="im_qq" type="text" value="{$smarty.get.im_qq|escape}" /></td>
				</tr>
			</table>
		</form>
		<table width="100%" cellspacing="0" cellpadding="0" class="tab-display" id="tab-color1">
			<tr>
				<td colspan="{if $utype eq factory}7{else}8{/if}" align="right" style="padding-right:50px;"><a href="{url index.php?app=member&act=user_list}" class="add btn-2">{$lang.consumer_list}</a>&nbsp;&nbsp;<a href="{url index.php?app=member&act=user_list&utype=factory}" class="add btn-2">工厂用户</a>&nbsp;&nbsp;<a href="{url index.php?app=member&act=user_list&utype=merchant}" class="add btn-2">供应商</a></td>
			</tr>
			<tr>
				<th width="20%" type="order" field="reg_time" order="ASC">注册日期</th>
				<th width="10%">{$lang.user_name}</th>
				<th width="11%">{$lang.im_qq}</th>
				<th width="11%">{$lang.phone_mob}</th>
				<th width="11%">{$lang.phone_tel}</th>
				<th width="6%" type="order" field="activation" order="ASC">{$lang.is_activation}</th>
				{if $utype neq factory && $utype neq merchant}
				<th width="9%" type="order" field="merch_name" order="ASC">{$lang.merchandiser}</th>
				{/if}
				<th width="20%">{$lang.handle}</th>
			</tr>
			<!--{foreach from=$users item=user}-->
			<tr>
				<td>{$user.reg_time|date}</td>
				<td>{$user.user_name|truncate:30}</td>
				<td>{$user.is_qq}</td>
				<td>{$user.phone_mob}</td>
				<td>{$user.phone_tel}</td>
				<td><!--{if $user.activation}-->{$lang.yes}<!--{else}-->{$lang.no}<!--{/if}--></td>
				{if $utype neq factory && $utype neq merchant}
				<td>{$user.merch_name}</td>
				{/if}
				<td><a href="<!-- {if $user.is_factory} -->{url app=member&act=edit_factory&uid=$user.user_id}<!-- {elseif $user.role eq USER_MERCHANT} -->{url app=merchant&act=edit&uid=$user.user_id}<!-- {else} -->{url app=member&act=edit_user&uid=$user.user_id}<!-- {/if} -->">{$lang.edit}</a>&nbsp;|&nbsp;<!-- {if $user.activation} --><a href="javascript:if(confirm('确认禁用此用户吗?')==true){location.href='{url app=member&act=forbid_user&uid=$user.user_id}';};">{$lang.forbid}</a>
					<!-- {else} --><a href="javascript:if(confirm('确认激活此用户吗?')==true){location.href='{url app=member&act=activation_user&uid=$user.user_id}';};">{$lang.activation}</a><!-- {/if} -->
					<!-- {if !$user.is_factory && $utype neq merchant} -->|&nbsp;<a href="{url app=member&act=assign_company&uid=$user.user_id}">{$lang.assign_company}</a><!-- {/if} -->
					<!-- {if $user.is_factory} -->|&nbsp;<a href="{url app=member&act=assign_qc_info&uid=$user.user_id}">{$lang.assign_qc}</a><!-- {/if} -->
					|&nbsp;<a href="javascript:if(confirm('确认删除此用户吗?')==true){location.href='{url app=member&act=del&uid=$user.user_id}';};">{$lang.delete}</a></td>
			</tr>
			<!--{/foreach}-->
		</table>
		{include file=page.html}
		<script language="javascript" type="text/javascript" src="{res file=js/tab_color.js}"></script> 
	</div>
	</div>
</body>
{$async_sendmail}
</html>